$(function () {
    let plus = document.querySelector('.plus')
    let subtract = document.querySelector('.subtract')
    let num = document.querySelector('.num')
    console.log(num, plus, subtract);

    plus.addEventListener('click', function () {
        num.value++;
    })
    subtract.addEventListener('click', function () {

        if (num.value > 1) {
            num.value--;
        }

    })
    num.addEventListener('keyup', function () {
        console.log(123);
        let numVal = num.value;
        if (numVal !== Number) {
            numVal = '';
        }
    })

    MagnifierF('MagnifierWrap2')
    let oldIindex = 0;
    let kinder = document.querySelectorAll('.kinder')
    kinder.forEach(function (item, index) {
        item.addEventListener('click', function () {
            kinder[oldIindex].classList.remove('active')
            item.classList.add('active')
            oldIindex = index;
        })
    })

    let prodrgp = document.querySelectorAll('.prodrg p')
    let prodrgUl = document.querySelectorAll('.prodrg ul')
    console.log(prodrgUl, prodrgp);
    let oldIndex = 0;
    prodrgp.forEach(function (item, index) {
        item.addEventListener('click', function () {
            prodrgp[oldIndex].classList.remove('active')
            item.classList.add('active')

            prodrgUl[oldIndex].classList.remove('on')
            prodrgUl[index].classList.add('on')
            oldIndex = index;
        })

    })


})